package com.hy.aicodegeneration.model.entity;

import com.mybatisflex.annotation.Column;
import com.mybatisflex.annotation.Id;
import com.mybatisflex.annotation.KeyType;
import com.mybatisflex.annotation.Table;
import com.mybatisflex.core.keygen.KeyGenerators;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;
import java.time.LocalDateTime;

/**
 * 提示词安全事件记录实体类
 */
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@Table("prompt_safety_event")
public class PromptSafetyEvent implements Serializable {

    private static final long serialVersionUID = 1L;

    /**
     * 主键id
     */
    @Id(keyType = KeyType.Generator, value = KeyGenerators.snowFlakeId)
    private Long id;

    /**
     * 用户id
     */
    @Column(value = "user_id", onInsertValue = "0")
    private Long userId;

    /**
     * 应用id
     */
    @Column(value = "app_id", onInsertValue = "0")
    private Long appId;

    /**
     * 原始提示词
     */
    @Column("original_prompt")
    private String originalPrompt;

    /**
     * 重写后的提示词
     */
    @Column("rewritten_prompt")
    private String rewrittenPrompt;

    /**
     * 风险类型
     */
    @Column("risk_type")
    private String riskType;

    /**
     * 风险关键词
     */
    @Column("risk_keywords")
    private String riskKeywords;

    /**
     * 处理结果(rewrite/reject)
     */
    @Column("process_result")
    private String processResult;

    /**
     * IP地址
     */
    @Column("ip_address")
    private String ipAddress;

    /**
     * 创建时间
     */
    @Column("create_time")
    private LocalDateTime createTime;

    /**
     * 更新时间
     */
    @Column("update_time")
    private LocalDateTime updateTime;

    /**
     * 是否删除(0-未删除,1-已删除)
     */
    @Column(value = "is_delete", isLogicDelete = true, onInsertValue = "0")
    private Integer isDelete;
}